<template>
  <!-- header -->
  <div style="display: flex; justify-content: center; align-items: center">
    <el-form :model="form" label-width="120px">
      <el-form-item label="用户姓名">
        <el-input style="width: 100%" v-model="form.name" placeholder="请输入姓名"></el-input>
      </el-form-item>
      <el-form-item label="用户密码">
        <el-input style="width: 100%" v-model="form.password" placeholder="请输入密码"></el-input>
      </el-form-item>
      <el-form-item label="用户电话">
        <el-input style="width: 100%" v-model="form.phone" placeholder="请输入电话号码"></el-input>
      </el-form-item>
    </el-form>
    <span style="display: flex; justify-content: center; align-items: center">
      <el-button type="primary" @click="save">确 定</el-button>
    </span>
  </div>
</template>


<script>
export default {
  name: "Main",
  data() {
    return {
      form: {},
    };
  },
  methods: {
    save() {
      this.$axios
        .post("http://localhost:8081/v1/user/add", this.form)
        .then((res) => {
          console.log(res);
        });
    },
  },
};
</script>





<style scoped>
</style>